package com.tensquare.recruit.service.impl;

import com.tensquare.recruit.dao.RecruitDao;
import com.tensquare.recruit.pojo.Recruit;
import com.tensquare.recruit.service.RecruitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RecruitServiceImpl implements RecruitService {
    @Autowired
    private RecruitDao recruitDao;

    /**
     * 1.查询推荐的招聘信息列表
     * @return 招聘信息
     */
    @Override
    public List<Recruit> recommend() {
        return recruitDao.findTop3ByStateOrderByCreatetimeDesc("2");
    }

    /**
     * 2.查询最新的招聘信息
     * @return 招聘信息
     */
    @Override
    public List<Recruit> newlist() {
        return recruitDao.findTop3ByStateNotOrderByCreatetimeDesc("2");
    }
}
